﻿@using System.Collections
@using Kojarskiy.Models
@using Kojarskiy.Core
@using SiteMap = Kojarskiy.Models.SiteMap
@model string

@{
    IEnumerable<SiteMap> siteMap;
    siteMap = SiteMapHelper.GetSiteTree(Model);    
}

@Html.Raw(Html.TreeView("locations", siteMap, m => m.Children.OrderBy(x => x.Order), l => "<a href=" + @Url.Action("Index", Model, new { rootId = l.SiteMapId }) + ">" + l.PageName + "</a>"))